def solution(values: list) -> int:
    # PLEASE DO NOT MODIFY THE FUNCTION SIGNATURE
    # write code here
    score = 0
    for i in range(len(values)-1):
        for j in range(i+1, len(values)):
            if values[i] + values[j] + i - j > score:
                score = values[i] + values[j] + i - j

    return score # Placeholder return

if __name__ == '__main__':
    print(solution(values=[8, 3, 5, 5, 6]) == 11)
    print(solution(values=[10, 4, 8, 7]) == 16)
    print(solution(values=[1, 2, 3, 4, 5]) == 8)